package org.medicalinstrument.database;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class DBManager {
	private static ComboPooledDataSource ds = null;
	static{
		//这里要注意的是：xml配置文件的名字一定要是c3p0-config.xml，可以doc参考帮助，帮助中有命名，如果名字写错了会无法加载驱动，空指针的错
		ds = new ComboPooledDataSource("MedicalInstrument");
	}
    public static Connection getCon() throws SQLException{
    	return ds.getConnection();
    }
    public static DataSource getDataSource(){
    	return ds;
    }
}
